<?php
/**
 * Order Traits
 * User: zng
 * Date: 2020/3/18
 * Time: 10:58
 */
namespace app\api\traits\model\order;

Trait Order {

    public function user()
    {
        return $this->hasOne(\app\api\model\user\UserInfo::class, 'uid', 'uid');
    }

    public function userNumber()
    {
        return $this->belongsTo(\app\api\model\user\UserNumber::class, 'uid');
    }

    public function food()
    {
        return $this->belongsTo(\app\api\model\foods\Foods::class, 'fid');
    }

    public function orderFoods()
    {
        return $this->hasMany(\app\api\model\order\OrderFoods::class, 'oid');
    }

}